﻿//Copyright (C) <2013>  <jonathan cleeve norton> All Rights Reserved 
//Contact jon.norton@fin-plus.co.uk website <http://www.fin-plus.co.uk/>
using System.Windows;
using System.Reflection;
using FinPlusAssembler;
using FinPlusInterfaces;

namespace FinPlusClientShell
{
    public partial class App : Application
    {
        private void ApplicationStartup(object s, StartupEventArgs a)
        {
            var path = Assembly.GetExecutingAssembly().ConfigPath();
           
            var helper = IOC.Singleton<IWindowHelper>();
            helper.Env = path.ConfigEnv();
            helper.Config = a.Args[1];

            helper.OpenSync(a.Args[0], 
                a.Args[1], 
                null,
                a.Args[2].EnumParse<Env>(Env.unknown),
                a.Args[3].EnumParse<ShowType>(ShowType.Show),
                a.Args[4].Trim('\''),
                a.Args[5].Trim('\'').Replace('¬',' '), 
                bool.Parse(a.Args[6]), 
                bool.Parse(a.Args[7]), 
                bool.Parse(a.Args[8]));
        } 
    }
}
